package cn.gz3c.uitest.viewmodel;

import android.annotation.SuppressLint;
import android.app.Application;
import android.content.Context;
import android.text.TextUtils;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.MutableLiveData;

import com.huawei.hms.audioeditor.HAEEditorLibraryApplication;
import com.huawei.hms.audioeditor.sdk.AudioParameters;
import com.huawei.hms.audioeditor.sdk.HAETimeLine;
import com.huawei.hms.audioeditor.sdk.HuaweiAudioEditor;
import com.huawei.hms.audioeditor.sdk.asset.HAEAsset;
import com.huawei.hms.audioeditor.sdk.asset.HAEAsset.HAEAssetType;
import com.huawei.hms.audioeditor.sdk.asset.HAEAudioAsset;
import com.huawei.hms.audioeditor.sdk.effect.EffectFactory;
import com.huawei.hms.audioeditor.sdk.effect.HAEEffect;
import com.huawei.hms.audioeditor.sdk.effect.HAEEffect.Options;
import com.huawei.hms.audioeditor.sdk.engine.audio.OrientationPoint;
import com.huawei.hms.audioeditor.sdk.engine.audio.RequestParas;
import com.huawei.hms.audioeditor.sdk.engine.audio.thumbnail.ThumbnailManager;
import com.huawei.hms.audioeditor.sdk.lane.HAEAudioLane;
import com.huawei.hms.audioeditor.sdk.lane.HAEEffectLane;
import com.huawei.hms.audioeditor.sdk.lane.HAELane.HAELaneType;
import com.huawei.hms.audioeditor.sdk.lane.HAELane.HAETrimType;
import com.huawei.hms.audioeditor.sdk.util.FileUtil;
import com.huawei.hms.audioeditor.sdk.util.SmartLog;
import com.huawei.hms.audioeditor.ui.R.string;
import com.huawei.hms.audioeditor.ui.editor.clip.DefaultPlayControlView;
import com.huawei.hms.audioeditor.ui.editor.trackview.fragment.EditPreviewFragment;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.CountDownLatch;

import cn.gz3c.uitest.t;

@SuppressLint("StaticFieldLeak")
public class EditPreviewViewModel extends AndroidViewModel {
    private final MutableLiveData<Long> a = new MutableLiveData<>();
    private final MutableLiveData<Integer> b = new MutableLiveData<>();
    private final MutableLiveData<Double> c = new MutableLiveData<>();
    private final MutableLiveData<String> ldUuid = new MutableLiveData<>();
    private final MutableLiveData<String> e = new MutableLiveData<>();
    private final MutableLiveData<Long> f = new MutableLiveData<>();
    private final MutableLiveData<String> g = new MutableLiveData<>();
    public MutableLiveData<Boolean> h = new MutableLiveData<>();
    public MutableLiveData<Boolean> i = new MutableLiveData<>();
    private final MutableLiveData<t> j = new MutableLiveData<>();
    private final MutableLiveData<Integer> k = new MutableLiveData<>();
    private final MutableLiveData<Integer> l = new MutableLiveData<>(-1);
    private final MutableLiveData<Double> m = new MutableLiveData<>();
    private final MutableLiveData<List<HAEAudioAsset>> ldListHAEAudioAsset = new MutableLiveData<>();
    private final MutableLiveData<String> o = new MutableLiveData<>();
    private final MutableLiveData<Integer> p = new MutableLiveData<>(0);
    private final MutableLiveData<Boolean> q = new MutableLiveData<>(false);
    private boolean r = false;
    private t s;
    private HuaweiAudioEditor huaweiAudioEditor;
    private HAETimeLine haeTimeLine;
    private HAEAudioLane haeAudioLane;
    private final List<HAEAudioAsset> w = new ArrayList<>();
    private EditPreviewFragment editPreviewFragment;
    private long y;
    private final Context context;

    public EditPreviewViewModel(@NonNull Application var1) {
        super(var1);
        this.context = var1.getApplicationContext();
        this.i.postValue(false);
    }

    public MutableLiveData<Long> d() {
        return this.a;
    }

    public void a(Long var1) {
        this.a.postValue(var1);
    }

    public MutableLiveData<Integer> m() {
        return this.b;
    }

    public void a(int var1, boolean var2) {
        this.p.postValue(var1);
        this.q.postValue(var2);
    }

    public MutableLiveData<Integer> B() {
        return this.p;
    }

    public MutableLiveData<Boolean> A() {
        return this.q;
    }

    public void a(Integer var1) {
        this.b.postValue(var1);
    }

    public MutableLiveData<Double> n() {
        return this.c;
    }

    public void a(double var1) {
        this.c.postValue(var1);
    }

    public void c(String var1) {
        this.g.postValue(var1);
    }

    public MutableLiveData<String> j() {
        return this.g;
    }

    public void a(Boolean var1) {
        this.h.postValue(var1);
    }

    public void b(Boolean var1) {
        this.i.postValue(var1);
    }

    public MutableLiveData<Boolean> r() {
        return this.i;
    }

    public MutableLiveData<Boolean> I() {
        return this.h;
    }

    public void b(String var1) {
        this.e.postValue(var1);
    }

    public MutableLiveData<String> t() {
        return this.e;
    }

    public void b(Long var1) {
        this.y = var1;
        this.f.postValue(var1);
    }

    public MutableLiveData<Long> i() {
        return this.f;
    }

    public long v() {
        return this.y;
    }

    public void a(t var1) {
        this.s = var1;
        this.j.postValue(var1);
    }

    public MutableLiveData<t> q() {
        return this.j;
    }

    public void b(int var1) {
        this.k.postValue(var1);
    }

    public MutableLiveData<Integer> s() {
        return this.k;
    }

    public MutableLiveData<Integer> h() {
        return this.l;
    }

    public void setLdUuid(String var1) {
        this.ldUuid.postValue(var1);
    }

    public MutableLiveData<String> getLdUuid() {
        return this.ldUuid;
    }

    public MutableLiveData<Double> u() {
        return this.m;
    }

    public MutableLiveData<List<HAEAudioAsset>> e() {
        return this.ldListHAEAudioAsset;
    }

    public void a(HuaweiAudioEditor var1) {
        this.huaweiAudioEditor = var1;
    }

    public HuaweiAudioEditor getHuaweiAudioEditor() {
        return this.huaweiAudioEditor;
    }

    public void a(HAETimeLine var1) {
        this.haeTimeLine = var1;
    }

    public HAETimeLine G() {
        return this.haeTimeLine;
    }

    public void L() {
        this.a(this.haeTimeLine.getDuration());
    }

    public void a(EditPreviewFragment var1) {
        this.editPreviewFragment = var1;
    }

    public void a(long var1) {
        this.huaweiAudioEditor.seekTimeLine(var1);
        this.b(var1);
        this.editPreviewFragment.a(var1);
    }

    public void a(String var1, String var2, boolean var3) {
        long var4;
        if (this.haeTimeLine != null && this.i().getValue() != null) {
            var4 = this.i().getValue();
        } else {
            var4 = 0L;
        }

        this.a(var1, var2, var4, var3);
        (new Thread(() -> {
            CountDownLatch var2x;
            CountDownLatch var10000 = var2x = new CountDownLatch(1);
//            var10000.<init> (1);
//            ArrayList var3;
            ArrayList var10001 = new ArrayList<>();
//            var3.<init> ();
            var10001.add(var2);
            ThumbnailManager.getInstance().generateWaveThumbnailCache(var10001, var2x);

            label22:
            {
                InterruptedException var7;
                label26:
                {
                    try {
                        var10000.await();
                    } catch (InterruptedException var5) {
                        var7 = var5;
                        break label26;
                    }

                    String var8 = "EditPreviewViewModel";
                    String var10 = "get wave cache complete";

                    SmartLog.i(var8, var10);
                    break label22;
                }

                InterruptedException var6 = var7;
                SmartLog.e("EditPreviewViewModel", com.huawei.hms.audioeditor.ui.p.a.a("got exception ").append(var6.getMessage()).toString());
            }

            this.M();
            this.K();
        })).start();
    }

    public void a(String var1, String var2, long var3, boolean var5) {
        if (var3 < 0L) {
            HAETimeLine var8;
            if ((var8 = this.haeTimeLine) != null) {
                var3 = var8.getCurrentTime();
            } else {
                var3 = 0L;
            }
        }

        HAEAudioAsset var6;
        if ((var6 = com.huawei.hms.audioeditor.ui.p.b.b().a().appendAudioAsset(var2, var3)) != null) {
            var6.setStartTime(var3);
            String var7 = "";
            if (!TextUtils.isEmpty(var2)) {
                var7 = com.huawei.hms.audioeditor.ui.p.a.a(".").append(FileUtil.getFileExtensionName(var2)).toString();
            }

            if (var1 != null && !var1.toUpperCase(Locale.ROOT).endsWith(var7.toUpperCase(Locale.ROOT))) {
                var1 = var1 + var7;
            }

            var6.setAudioName(var1);
            var6.setEndTime(var6.getOriginLength() + var3);
            if (var5) {
                var6.reduceNoise(true);
            }

            this.setLdUuid("");
            this.K();
        }

    }

    public void a() {
        HAEAsset var1 = this.w();
        if (this.haeTimeLine != null && var1 != null) {
            if (var1.getType() == HAEAssetType.AUDIO) {
                this.haeTimeLine.getAudioLane(var1.getLaneIndex()).removeAsset(var1.getIndex());
                this.setLdUuid("");
                this.K();
            }
        }
    }

    public void a(HAEAsset var1, Long var2, int var3) {
        if (var1 != null) {
            HAEAudioLane var4;
            if ((var4 = this.haeTimeLine.getAudioLane(var1.getLaneIndex())) != null) {
                SmartLog.i("EditPreviewViewModel", com.huawei.hms.audioeditor.ui.p.a.a("index = ").append(var1.getIndex()).append(", time = ").append(var2).append(", direction = ").append(var3).toString());
                if (var3 > 0) {
                    var4.cutAsset(var1.getIndex(), var2, HAETrimType.TRIM_IN);
                } else {
                    var4.cutAsset(var1.getIndex(), var2, HAETrimType.TRIM_OUT);
                }

                this.K();
            }
        }
    }

    public void a(HAEAudioLane var1) {
        if (var1 != null) {
            this.haeAudioLane = var1;
            this.J();
            this.ldListHAEAudioAsset.postValue(this.w);
        }
    }

    public HAEAudioLane f() {
        return this.haeAudioLane;
    }

    public HAEAsset w() {
        if (!TextUtils.isEmpty(ldUuid.getValue())) {
            HAETimeLine haeTimeLine = this.haeTimeLine;
            if (haeTimeLine != null) {
                for (HAEAudioLane audioLane : haeTimeLine.getAllAudioLane()) {
                    for (HAEAsset asset : audioLane.getAssets()) {
                        HAEAsset haeAsset;
                        if ((haeAsset = asset).getUuid().equals(this.ldUuid.getValue())) {
                            return haeAsset;
                        }
                    }
                }
            }
        }
        return null;
    }

    public HAEAsset E() {
        MutableLiveData var1;
        if ((var1 = this.ldUuid) != null && !TextUtils.isEmpty((CharSequence) var1.getValue())) {
            HAETimeLine var4;
            if ((var4 = this.haeTimeLine) != null) {
                Iterator var5 = var4.getAllAudioLane().iterator();

                while (var5.hasNext()) {

                    for (HAEAsset haeAsset : ((HAEAudioLane) var5.next()).getAssets()) {
                        HAEAsset var3;
                        if ((var3 = haeAsset).getUuid().equals(this.o.getValue())) {
                            return var3;
                        }
                    }
                }
            }
        }
        return null;
    }

    public void J() {
        if (this.haeTimeLine != null) {
            this.b();
            this.ldListHAEAudioAsset.postValue(this.w);
        }

    }

    public void M() {
        HAETimeLine var1;
        if ((var1 = this.haeTimeLine) != null) {
            long var10 = 9223372036854775807L;
            Iterator var3 = var1.getAllAudioLane().iterator();

            while (true) {
                HAEAudioLane var4;
                do {
                    if (!var3.hasNext()) {
                        int var7;
                        Context var12;
                        if ((var12 = HAEEditorLibraryApplication.getContext()) == null) {
                            byte var11 = 1;
                            var7 = var11;
                        } else {
                            byte var13 = 1;
                            boolean var15 = false;
                            int var16 = com.huawei.hms.audioeditor.ui.common.utils.a.a(var12);
                            float var6 = (float) com.huawei.hms.audioeditor.ui.common.utils.a.a(70.0F);
                            var7 = 1;

                            while (true) {
                                if (var7 > 9) {
                                    var7 = var13;
                                    break;
                                }

                                double var8 = (double) var16 / (double) var6;
                                if ((long) (com.huawei.hms.audioeditor.ui.common.utils.d.a(var7) * var8) > var10) {
                                    var15 = true;
                                    break;
                                }

                                ++var7;
                            }

                            if (!var15) {
                                var7 = 9;
                            }
                        }

                        this.a(var7);
                        return;
                    }
                } while ((var4 = (HAEAudioLane) var3.next()) == null);
                for (HAEAsset haeAsset : var4.getAssets()) {
                    HAEAsset var5;
                    if ((var5 = haeAsset) != null && var5.getDuration() < var10) {
                        var10 = var5.getDuration();
                    }
                }
            }
        }
    }

    public List<HAEAudioAsset> b() {
        this.w.clear();
        List var1;
        if ((var1 = this.haeTimeLine.getAllAudioLane()).size() > 0) {
            Iterator var2 = var1.iterator();

            while (var2.hasNext()) {
                this.a((HAEAudioLane) var2.next(), true);
            }
        }

        return this.w;
    }

    public void a(HAEAudioLane var1, boolean var2) {
        if (var1 != null) {
            if (!var2) {
                this.w.clear();
            }

            List var4;
            if ((var4 = var1.getAssets()) != null && var4.size() > 0) {
                for (Object var3 : var4) {
                    this.w.add((HAEAudioAsset) var3);
                }
            }

            if (!var2) {
                this.ldListHAEAudioAsset.postValue(this.w);
            }
        }

    }

    public boolean a(float var1, float var2) {
        HAEAsset var3;
        return (var3 = this.w()) != null && var3.getType() == HAEAssetType.AUDIO && this.x().changeAssetSpeed(this.w().getIndex(), var1, var2);
    }

    public boolean a(float var1) {
        HAEAsset var2;
        if ((var2 = this.w()) == null) {
            return (var2 = this.E()) != null && var2.getType() == HAEAssetType.AUDIO && this.y().changeAssetPitch(var2.getIndex(), var1);
        } else {
            return var2.getType() == HAEAssetType.AUDIO && this.x().changeAssetPitch(this.w().getIndex(), var1);
        }
    }

    public boolean a(int var1) {
        HAEAsset var2;
        if ((var2 = this.w()) == null) {
            return (var2 = this.E()) != null && var2.getType() == HAEAssetType.AUDIO && this.y().changeAssetEnvironmentType(var2.getIndex(), var1);
        } else {
            return var2.getType() == HAEAssetType.AUDIO && this.x().changeAssetEnvironmentType(this.w().getIndex(), var1);
        }
    }

    public boolean setFade(int var1, int var2) {
        return this.w() != null && this.x().setAudioAssetFade(this.w().getIndex(), var1, var2);
    }

    public HAEAudioLane x() {
        HAEAudioAsset var1;
        return (var1 = (HAEAudioAsset) this.w()) == null ? null : (HAEAudioLane) this.G().getAllAudioLane().get(var1.getLaneIndex());
    }

    public HAEAudioLane y() {
        HAEAudioAsset var1;
        return (var1 = (HAEAudioAsset) this.E()) == null ? null : (HAEAudioLane) this.G().getAllAudioLane().get(var1.getLaneIndex());
    }

    public boolean a(HAELaneType var1, int var2, int var3, int var4, long var5) {
        return this.haeTimeLine.moveAssetPosition(var1, var2, var3, var4, var5);
    }

    public boolean a(HAELaneType var1, int var2, int var3, long var4) {
        if (var1 == HAELaneType.AUDIO) {
            EditPreviewViewModel var10000 = this;
            HAEAudioLane var6 = this.haeTimeLine.appendAudioLane();
            return var10000.haeTimeLine.moveAssetPosition(var1, var2, var3, var6.getIndex(), var4);
        } else {
            return false;
        }
    }

    public boolean a(HAEAsset var1) {
        HAEAudioLane var2;
        return (var2 = this.haeTimeLine.getAudioLane(var1.getLaneIndex())) != null && var2.getAssets().contains(var1);
    }

    public synchronized void K() {
        this.s.c().a.clear();
        this.s.c().b.clear();
        HAETimeLine haeTimeLine;
        if ((haeTimeLine = this.haeTimeLine) != null) {
            Iterator<HAEAudioLane> var5 = haeTimeLine.getAllAudioLane().iterator();
            while (true) {
                HAEAudioLane haeAudioLane;
                do {
                    if (!var5.hasNext()) {
                        this.j.postValue(this.s);
                        this.L();
                        return;
                    }
                } while ((haeAudioLane = (HAEAudioLane) var5.next()).getAssets().isEmpty());

                ArrayList var3;
                var3 = new ArrayList<>();

                for (int var4 = 0; var4 < haeAudioLane.getAssets().size(); ++var4) {
                    this.a(haeAudioLane.getAssets().get(var4), this.getLdUuid().getValue());
                }

                var3.addAll(haeAudioLane.getAssets());
                this.s.c().a.add(new t.b(haeAudioLane.getIndex(), var3, 1));
            }
        }
    }

    public t.b a(HAEAsset var1, String var2, String var3) {
        ArrayList var4;
        ArrayList var10000 = var4 = new ArrayList<>();
//        var4.<init> ();
        HAEEffectLane var10001 = this.haeTimeLine.appendEffectLane();
        String var10004 = var2;
        var2 = this.getLdUuid().getValue();
        HAEEffect var10002 = EffectFactory.create(new Options(var10004, "", var3, var2));
        var10002.setStartTime(var1.getStartTime());
        var10002.setEndTime(var1.getEndTime());
        var10000.add(var10001.appendEffect(var10002));
        return new t.b(var1.getIndex(), var4, 2, this.getLdUuid().getValue());
    }

    public void a(HAEAsset var1, String var2) {
        if (var1.getUuid().equals(var2)) {
            RequestParas var3;
            String var4;
            HAEAudioAsset var6;
            if ((var3 = (var6 = (HAEAudioAsset) var1).getRequestParas()).getSurroundModule() == 1) {
                switch (var3.getSurroundType()) {
                    case 0:
                        var4 = this.context.getResources().getString(string.sound_0);
                        break;
                    case 1:
                        var4 = this.context.getResources().getString(string.sound_1);
                        break;
                    case 2:
                        var4 = this.context.getResources().getString(string.sound_2);
                        break;
                    case 3:
                        var4 = this.context.getResources().getString(string.sound_3);
                        break;
                    default:
                        var4 = "无";
                }

                if (!var4.equals("无")) {
                    this.s.c().b.add(this.a(var1, "SOUND_FIELD", var4));
                }
            }

            if (var3.getLbaModule() == 1) {
                var4 = this.context.getResources().getString(string.heavy_bass);
                this.s.c().b.add(this.a(var1, "STYLE", var4));
            }

            if (var3.getEqModule() == 1) {
                int[] var10000 = var3.getsEQRGain();
                int[] var7 = var3.getsEQLGain();
                if (!Arrays.equals(var10000, AudioParameters.EQUALIZER_DEFAULT_VALUE) && !Arrays.equals(var7, AudioParameters.EQUALIZER_DEFAULT_VALUE)) {
                    var4 = this.context.getResources().getString(string.equilibrium);
                    this.s.c().b.add(this.a(var1, "EQUALIZER", var4));
                }
            }

            double var8;
            if (com.huawei.hms.audioeditor.ui.common.utils.a.c(var8 = var6.getSoundType(), 0.75D)) {
                var4 = this.getApplication().getResources().getString(string.uncle);
            } else if (com.huawei.hms.audioeditor.ui.common.utils.a.c(var8, 1.7999999523162842D)) {
                var4 = this.getApplication().getResources().getString(string.lori);
            } else if (com.huawei.hms.audioeditor.ui.common.utils.a.c(var8, 1.440000057220459D)) {
                var4 = this.getApplication().getResources().getString(string.female_voice);
            } else if (com.huawei.hms.audioeditor.ui.common.utils.a.c(var8, 0.6499999761581421D)) {
                var4 = this.getApplication().getResources().getString(string.male_voice);
            } else if (com.huawei.hms.audioeditor.ui.common.utils.a.c(var8, 0.550000011920929D)) {
                var4 = this.getApplication().getResources().getString(string.monsters);
            } else {
                var4 = this.getApplication().getResources().getString(string._none);
            }

            if (!var4.equals(this.getApplication().getResources().getString(string._none))) {
                this.s.c().b.add(this.a(var1, "SETTING_SOUND_TYPE", var4));
            }

            if (var6.isReduceNoise()) {
                var2 = this.getApplication().getResources().getString(string.reduce_noise);
                this.s.c().b.add(this.a(var1, "REDUCE_NOISE_TYPE", var2));
            }

            if (var3.getEtModule() == 1) {
                switch (var3.getEnvironmentType()) {
                    case 0:
                        var2 = this.context.getResources().getString(string.environment_gb);
                        break;
                    case 1:
                        var2 = this.context.getResources().getString(string.environment_tel);
                        break;
                    case 2:
                        var2 = this.context.getResources().getString(string.environment_sx);
                        break;
                    case 3:
                        var2 = this.context.getResources().getString(string.environment_cd);
                        break;
                    default:
                        var2 = "无";
                }

                if (!var2.equals("无")) {
                    this.s.c().b.add(this.a(var1, "ENVIRONMENT_TYPE", var2));
                }
            }

            this.e(var1.getUuid());
        }

    }

    public long getDuration() {
        HAEAsset var1;
        return (var1 = this.w()) != null ? var1.getDuration() : 0L;
    }

    public MutableLiveData<String> D() {
        return this.o;
    }

    public void e(String var1) {
        this.o.postValue(var1);
    }

    public String F() {
        for (int var1 = 0; var1 < this.s.a().size(); ++var1) {
            t.b var2;
            List var3;
            if ((this.s.a().get(var1)).a == 2 && (var3 = (var2 = (this.s.a().get(var1)).b).b) != null && var3.size() > 0 && var2.e == 2 && var2.b.get(0).getUuid().equals(this.getLdUuid().getValue())) {
                return var2.b.get(0).getOptions().getEffectType();
            }
        }

        return "";
    }

    public HAEAsset a(String var1) {
        if (TextUtils.isEmpty(var1)) {
            return null;
        } else {
            HAETimeLine var4;
            if ((var4 = this.haeTimeLine) == null) {
                return null;
            } else {
                Iterator var5 = var4.getAllAudioLane().iterator();

                while (var5.hasNext()) {

                    for (HAEAsset haeAsset : ((HAEAudioLane) var5.next()).getAssets()) {
                        HAEAsset var3;
                        if ((var3 = haeAsset).getUuid().equals(var1)) {
                            return var3;
                        }
                    }
                }

                return null;
            }
        }
    }

    public void a(DefaultPlayControlView var1) {
    }

    public boolean o() {
        return this.r;
    }

    public void a(boolean var1) {
        this.r = var1;
    }

    public boolean p() {
        boolean var1 = true;

        for (int var2 = 0; var2 < this.b().size(); ++var2) {
            if (this.b().get(var2).getUuid().equals(this.getLdUuid().getValue())) {
                var1 = false;
                break;
            }
        }

        return var1;
    }

    public boolean a(OrientationPoint var1) {
        HAEAsset var2;
        if ((var2 = this.w()) == null) {
            return (var2 = this.E()) != null && var2.getType() == HAEAssetType.AUDIO ? this.y().changeSpatialOrientation(var2.getIndex(), var1) : false;
        } else {
            return var2.getType() != HAEAssetType.AUDIO ? false : this.x().changeSpatialOrientation(this.w().getIndex(), var1);
        }
    }

    public OrientationPoint C() {
        HAEAsset var1;
        if ((var1 = this.w()) == null) {
            return (var1 = this.E()) != null && var1.getType() == HAEAssetType.AUDIO ? this.y().getSpatialOrientation(var1.getIndex()) : null;
        } else {
            return var1.getType() != HAEAssetType.AUDIO ? null : this.x().getSpatialOrientation(this.w().getIndex());
        }
    }

    public int l() {
        List var10000 = this.G().getAllAudioLane();
        int var2 = 0;
        Iterator var1 = var10000.iterator();

        while (var1.hasNext()) {
            if (((HAEAudioLane) var1.next()).getAssets().size() > 0) {
                ++var2;
            }
        }

        return var2;
    }

    public int c() {
        return this.b().size();
    }

    public boolean H() {
        if (this.l() < 10 && this.c() < 100) {
            return false;
        } else {
            Context var10000 = this.context;
            com.huawei.hms.audioeditor.ui.common.utils.i.a(var10000, var10000.getResources().getString(string.tip_error_audio_num)).a();
            return true;
        }
    }
}
